<?php
class Kajedugbenjol extends CI_Controller{
    function  __construct() {
        parent::__construct();
	$this->load->helper(array('form', 'url'));
	$this->load->library('form_validation');
      }

function index(){
        $this->load->model('Kajedugbenjol_model');
	    $data['pesan'] = $this->Kajedugbenjol_model->Cari_pesan();
		$data['images'] = $this->Kajedugbenjol_model->get_images();
	    $this->load->view('admin_views/kajedugbenjol/kajedugbenjol',$data);
		
    }
function edit(){	
if($_POST) {  
        $this->load->model('Kajedugbenjol_model');
	        $detail =  $this->input->post('elm1');
//			echo $detail;
			$id='1';
			$this->Kajedugbenjol_model->edit($id,$detail);
            echo ' <h2>Info Berhasil Diupdate</h2>';
			 
			echo anchor('kajedugbenjol', 'Back'); 
	//		$data['pesan'] = $this->Kajedugbenjol_model->Cari_pesan();
   // 	    $this->load->view('admin_views/kajedugbenjol/kajedugbenjol',$data);
			}   
}
function delete($mana){	
        $this->load->model('Kajedugbenjol_model');
	    $this->Kajedugbenjol_model->delete($mana);    
		echo ' <h2>Foto Berhasil Didelete</h2>';
		echo anchor('kajedugbenjol', 'Back'); 					
			}   

function gambar(){	
if($_POST) {
        $this->load->model('Kajedugbenjol_model');
		$detail =  $this->input->post('poto');
    	$this->Kajedugbenjol_model->potonya($detail);
		$this->load->model('Kajedugbenjol_model');
		$data['images'] = $this->Kajedugbenjol_model->get_images();
		//$this->load->view('kajedugbenjol/kajedugbenjol',$data);
$apa = $this->session->userdata('poto');
$array_items = array('poto' => '');
$this->session->unset_userdata($array_items);
if ($apa!='') {
            echo '<h2>'.$apa.'</h2>';
} else {
            echo ' <h2>Foto Berhasil Diupload</h2>';
		}	
			echo anchor('kajedugbenjol', 'Back'); 					
}
}
}
?>
